from django.db import models
from apps.homepage.models import ZtStory

# Create your models here.
#研发需求描述表
class ZtStorySpec(models.Model):

    # id = models.AutoField(primary_key=True)  # 确保定义了id字段
    story = models.ForeignKey(ZtStory, on_delete=models.PROTECT, db_column='story', related_name='storySpec_story')
    version = models.IntegerField()
    spec = models.TextField()

    class Meta:
        db_table = 'zt_storyspec'
        unique_together = (('story', 'version'),)  # 确保 story+version 的唯一性